import { S } from '../../s';
import { IPSControlAttribute } from '../ipscontrol-attribute';
import { IPSControlLogic } from '../ipscontrol-logic';
import { IPSControlRender } from '../ipscontrol-render';
import { IPSDEFDCatGroupLogic } from './ipsdefdcat-group-logic';
import { IPSDEFormDetail } from './ipsdeform-detail';
import { IPSLayout } from '../layout/ipslayout';
import { IPSLayoutItem } from '../layout/ipslayout-item';
import { IPSLayoutPos } from '../layout/ipslayout-pos';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysCss } from '../../res/ipssys-css';
import { IPSSysImage } from '../../res/ipssys-image';
import { IPSSysPFPlugin } from '../../res/ipssys-pfplugin';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEFormDetailImpl
  extends PSModelObjectImpl
  implements IPSDEFormDetail, IPSLayoutItem
{
  protected cappslanguageres: IPSLanguageRes;
  getCapPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.cappslanguageres ||
      (this.cappslanguageres = this.fillObjectModel(
        S._276,
        this.M.getCapPSLanguageRes,
        S._2a8,
      ) as IPSLanguageRes)
    );
  }

  get caption(): string {
    return this.M.caption;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get columnAlign(): 'LEFT' | 'CENTER' | 'RIGHT' {
    return this.M.columnAlign;
  }

  get contentHeight(): number {
    return this.M.contentHeight != null ? this.M.contentHeight : 0.0;
  }

  get contentWidth(): number {
    return this.M.contentWidth != null ? this.M.contentWidth : 0.0;
  }

  get cssStyle(): string {
    return this.M.cssStyle;
  }

  get detailStyle(): 'DEFAULT' | 'STYLE2' | 'STYLE3' | 'STYLE4' {
    return this.M.detailStyle;
  }

  get detailType():
    | 'FORMPAGE'
    | 'TABPANEL'
    | 'TABPAGE'
    | 'FORMITEM'
    | 'USERCONTROL'
    | 'FORMPART'
    | 'GROUPPANEL'
    | 'DRUIPART'
    | 'RAWITEM'
    | 'BUTTON'
    | 'IFRAME'
    | 'FORMITEMEX'
    | 'MDCTRL' {
    return this.M.detailType;
  }

  get dynaClass(): string {
    return this.M.dynaClass;
  }

  get height(): number {
    return this.M.height != null ? this.M.height : 0.0;
  }

  get labelCssStyle(): string {
    return this.M.labelCssStyle;
  }

  get labelDynaClass(): string {
    return this.M.labelDynaClass;
  }

  protected labelpssyscss: IPSSysCss;
  getLabelPSSysCss(): IPSSysCss | null {
    return (
      this.labelpssyscss ||
      (this.labelpssyscss = this.fillObjectModel(
        S._278,
        this.M.getLabelPSSysCss,
        S._2e7,
      ) as IPSSysCss)
    );
  }

  protected pscontrolattributes: IPSControlAttribute[];
  getPSControlAttributes(): IPSControlAttribute[] | null {
    return (
      this.pscontrolattributes ||
      (this.pscontrolattributes = this.fillChildListModel(
        this.M.getPSControlAttributes,
        S._3f5,
      ) as IPSControlAttribute[])
    );
  }

  findPSControlAttribute(objKey: any): IPSControlAttribute | null {
    return this.getPSModel5(
      S._3f5,
      this.getPSControlAttributes(),
      objKey,
    ) as IPSControlAttribute;
  }

  protected pscontrollogics: IPSControlLogic[];
  getPSControlLogics(): IPSControlLogic[] | null {
    return (
      this.pscontrollogics ||
      (this.pscontrollogics = this.fillChildListModel(
        this.M.getPSControlLogics,
        S._38d,
      ) as IPSControlLogic[])
    );
  }

  findPSControlLogic(objKey: any): IPSControlLogic | null {
    return this.getPSModel5(
      S._38d,
      this.getPSControlLogics(),
      objKey,
    ) as IPSControlLogic;
  }

  protected pscontrolrenders: IPSControlRender[];
  getPSControlRenders(): IPSControlRender[] | null {
    return (
      this.pscontrolrenders ||
      (this.pscontrolrenders = this.fillChildListModel(
        this.M.getPSControlRenders,
        S._3f6,
      ) as IPSControlRender[])
    );
  }

  findPSControlRender(objKey: any): IPSControlRender | null {
    return this.getPSModel5(
      S._3f6,
      this.getPSControlRenders(),
      objKey,
    ) as IPSControlRender;
  }

  protected psdefdgrouplogics: IPSDEFDCatGroupLogic[];
  getPSDEFDGroupLogics(): IPSDEFDCatGroupLogic[] | null {
    return (
      this.psdefdgrouplogics ||
      (this.psdefdgrouplogics = this.fillChildListModel(
        this.M.getPSDEFDGroupLogics,
        S._a8,
      ) as IPSDEFDCatGroupLogic[])
    );
  }

  findPSDEFDCatGroupLogic(objKey: any): IPSDEFDCatGroupLogic | null {
    return this.getPSModel5(
      S._a8,
      this.getPSDEFDGroupLogics(),
      objKey,
    ) as IPSDEFDCatGroupLogic;
  }

  protected pslayout: IPSLayout;
  getPSLayout(): IPSLayout | null {
    return (
      this.pslayout ||
      (this.pslayout = this.fillObjectModel(
        S._298,
        this.M.getPSLayout,
        S._2e8,
      ) as IPSLayout)
    );
  }

  protected pslayoutpos: IPSLayoutPos;
  getPSLayoutPos(): IPSLayoutPos | null {
    return (
      this.pslayoutpos ||
      (this.pslayoutpos = this.fillObjectModel(
        S._299,
        this.M.getPSLayoutPos,
        S._2e9,
      ) as IPSLayoutPos)
    );
  }

  protected pssyscss: IPSSysCss;
  getPSSysCss(): IPSSysCss | null {
    return (
      this.pssyscss ||
      (this.pssyscss = this.fillObjectModel(
        S._278,
        this.M.getPSSysCss,
        S._2ac,
      ) as IPSSysCss)
    );
  }

  protected pssysimage: IPSSysImage;
  getPSSysImage(): IPSSysImage | null {
    return (
      this.pssysimage ||
      (this.pssysimage = this.fillObjectModel(
        S._27b,
        this.M.getPSSysImage,
        S._2ad,
      ) as IPSSysImage)
    );
  }

  protected pssyspfplugin: IPSSysPFPlugin;
  getPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.pssyspfplugin ||
      (this.pssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getPSSysPFPlugin,
        S._2a7,
      ) as IPSSysPFPlugin)
    );
  }

  protected showmoremgrpsdeformdetail: IPSDEFormDetail;
  getShowMoreMgrPSDEFormDetail(): IPSDEFormDetail | null {
    return (
      this.showmoremgrpsdeformdetail ||
      (this.showmoremgrpsdeformdetail = this.fillObjectModel(
        S._ab,
        this.M.getShowMoreMgrPSDEFormDetail,
        S._2ea,
      ) as IPSDEFormDetail)
    );
  }

  get showMoreMode(): 0 | 1 | 2 {
    return this.M.showMoreMode != null ? this.M.showMoreMode : 0;
  }

  get width(): number {
    return this.M.width != null ? this.M.width : 0.0;
  }

  get repeatContent(): boolean {
    return this.M.repeatContent != null ? this.M.repeatContent : false;
  }

  get showCaption(): boolean {
    return this.M.showCaption;
  }
  get cls(): string {
    return 'PSDEFormDetailImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._3f7 || cls == S._ab || cls == S._ac) return true;
    return super.instanceof(cls);
  }
}
